const arr =[1,2,3,4,5]
simpleForOf(arr,(item)=>{
    console.log(item);
})

function simpleForOf(iterable,cb) {
    const iterator = iterable[Symbol.iterator]()
    while(true){
        const {value,done} = iterator.next()
        if(done){
            break
        }
        cb(value)
    }
}